<?php
/**
 * @author: liaofei<136327134@qq.com>
 * @day: 2020/7/9
 */

namespace app\services\other;

use app\services\BaseServices;
use think\facade\Db;

class CarouselServices extends BaseServices
{
    public function list(): array
    {
        [$page, $limit] = $this->getPageValue();
        $list = Db::table('eb_carousel')->page($page, $limit)->select()->toArray();
        $count = Db::table('eb_carousel')->count();
        return [$list, $count];
    }

    public function update($where, $data): int
    {
        return Db::table('eb_carousel')->where($where)->update($data);
    }

    public function save($data)
    {
        return Db::table('eb_carousel')->save($data);
    }
}